<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Symbol解决字符串耦合问题</title>
</head>
<body>
    <script>
        // 只会出现一个 李四，后面的把前面的覆盖掉了
        let grade1 = {
            "李四" : {css:65,js:95},
            "李四" : {css:45,js:65}
        };
        console.log(grade1);


        // 只会出现一个 李四，后面的把前面的覆盖掉了
        let user1 = "李四";
        let user2 = "李四";
        let grade2 = {
            [user1] : {css:65,js:95},
            [user2] : {css:45,js:65}
        };
        console.log(grade2);


        let use1 = {
            name : "李四",
            key : Symbol()
        };

        let use2 = {
            name : "李四",
            key : Symbol()
        };

        let grade3 = {
            [use1.key] : {css:65,js:95},
            [use2.key] : {css:45,js:65}
        };
        console.log(grade3);
        console.log(grade3[use1.key]);
    </script>
</body>
</html>